/*
 *
 *
 */

#ifndef WINDOW_CARD_H
#define WINDOW_CARD_H

#include "gkt_card.h"

struct _window_card_service_desc {
	uint8_t	type;
	uint16_t	data;
} __PACKED;
typedef struct _window_card_service_desc
	window_card_service_desc_s;

enum {
	WINDOW_CARD_SERVICE_TYPE_ENROLLED_CARD = 0,
	WINDOW_CARD_SERVICE_TYPE_VENDOR_LOGO,
	WINDOW_CARD_SERVICE_TYPE_FACTORY_TEST,
	WINDOW_CARD_SERVICE_TYPE_AGING_TEST,
	WINDOW_CARD_SERVICE_TYPE_CUSTOM_CONFIG,
	WINDOW_CARD_SERVICE_TYPE_MAX
};
#define WINDOW_CARD_SERVICE_TYPE_UNUSED	0xFF

#define WINDOW_CARD_BLOCK_HEADER_MAGIC	0x474B54CD
#define WINDOW_CARD_BLOCK_HEADER_VERSION	0x01
#define GKT_CARD_SERVICE_ATTR_MAXNUMS	3

typedef struct _window_card_block_header {
	uint32_t	magic;
	uint8_t	version;
	window_card_service_desc_s	service_descs[GKT_CARD_SERVICE_ATTR_MAXNUMS];
	uint16_t	crc16;
} window_card_block_header_s;
#define WINDOW_CARD_BLOCK_HEADER_SIZE	sizeof(window_card_block_header_s)

int window_card_service_mark(uint32_t type, uint16_t data);

#endif	/* WINDOW_CARD_H */

